% Create a table for thermophysical properties of common materials at 300K
material_names = {
    'Asbestos-cement board', 'Gypsum or plaster board', 'Plywood', ...
    'Sheathing, regular density', 'Acoustic tile', 'Hardboard, siding', ...
    'Hardboard, high density', 'Particle board, low density', ...
    'Particle board, high density', 'Hardwoods (oak, maple)', ...
    'Softwoods (fir, pine)', 'Cement mortar', 'Brick, common', ...
    'Brick, face', 'Clay tile, 1 cell', 'Clay tile, 3 cells', ...
    'Concrete block, sand/gravel', 'Concrete block, cinder aggregate', ...
    'Concrete block, rectangular core', 'Cement plaster', ...
    'Gypsum plaster', 'Gypsum plaster, vermiculite', ...
    'Glass fiber, paper faced', 'Glass fiber, coated', ...
    'Cellular glass', 'Polystyrene, expanded (extruded)', ...
    'Polystyrene, expanded (molded beads)', 'Mineral fiberboard', ...
    'Cork', 'Cork, granulated', 'Diatomaceous silica, coarse', ...
    'Diatomaceous silica, fine powder', 'Vermiculite, flakes', ...
    'Urethane, rigid foam', 'Aluminum foil', 'Aluminum foil, laminate', ...
    'Silica powder, evacuated'
};

% Corresponding density (kg/m^3), thermal conductivity (W/m.K), and specific heat (J/kg.K)
density = [
    1920, 800, 545, 290, 290, 640, 1010, 590, 1000, 720, 510, ...
    1860, 1920, 2083, NaN, NaN, NaN, NaN, NaN, 1860, 1680, 720, ...
    16, 32, 145, 55, 16, 265, 120, 160, 350, 200, 80, 70, 40, ...
    120, 160
];

thermal_conductivity = [
    0.58, 0.17, 0.12, 0.055, 0.058, 0.094, 0.15, 0.078, 0.17, ...
    0.16, 0.12, 0.72, 0.72, 1.3, 0.52, 0.69, 1.0, 0.67, 1.1, ...
    0.72, 0.22, 0.25, 0.046, 0.038, 0.058, 0.027, 0.04, 0.049, ...
    0.039, 0.045, 0.069, 0.052, 0.068, 0.026, 0.00016, 0.000017, ...
    0.0017
];

specific_heat = [
    NaN, NaN, 1215, 1300, 1340, 1170, 1380, 1300, 1300, 1255, 1380, 780, 835, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 1085, NaN, NaN, 835, 1000, 1210, 1210, NaN, 1590, 1800, NaN, NaN, NaN, NaN, NaN, 1045, NaN, NaN
];

% Create the table
properties_table = table(material_names', density', thermal_conductivity', specific_heat', ...
                         'VariableNames', {'Material', 'Density', 'ThermalConductivity', 'SpecificHeat'})

% Function to retrieve material properties by name

%

function [density, thermal_conductivity, specific_heat] = getMaterialProperties(material_name, properties_table)
    row = strcmp(properties_table.Material, material_name);
    if any(row)
        density = properties_table.Density(row);
        thermal_conductivity = properties_table.ThermalConductivity(row);
        specific_heat = properties_table.SpecificHeat(row);
    else
        error('Material not found in the table.');
    end
end

